﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ECode.ModbusTester.Lib.ViewModel
{
    /// <summary>
    /// 接收区ViewModel
    /// </summary>
    public class ReceiveViewModel : BaseViewModel
    {
        #region
        private string _recData;
        /// <summary>
        /// 接收数据
        /// </summary>
        public string RecData { get { return _recData; } set { _recData = value; OnPropertyChanged("RecData"); } }
        /// <summary>
        /// 是否16进制显示
        /// </summary>
        public bool IsHexShow { get; set; }
        #endregion

        #region
        /// <summary>
        /// 接收数据
        /// </summary>
        /// <param name="data"></param>
        public void Receive(string data)
        {
            RecData += data;
        }
        /// <summary>
        /// 清空数据
        /// </summary>
        public void Clear()
        {
            RecData = string.Empty;
        }

        #endregion
    }
}
